package com.yuki.fwwb.Controller;

import com.yuki.fwwb.Entity.Sjt;
import com.yuki.fwwb.Entity.StationChaneByDay;
import com.yuki.fwwb.Entity.TimeNum;
import com.yuki.fwwb.Service.TripsStationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@Api("桑吉图")
public class TripsStationController {
    @Autowired
    TripsStationService stationService;
    @GetMapping("/findAllTripsStation")
    @ApiOperation(value = "桑吉图数据")
    public List<Sjt> findAllTripsStation(){
        return stationService.findAllTripsStation();
    };


    @ApiOperation("返回站台时段流量图 pie")
    @PostMapping("/findTimeNum")
    public List<TimeNum> findTimeNum() {
        List<TimeNum> timeNums = new ArrayList<>();
        timeNums.add(new TimeNum("6-8", 1243));
        timeNums.add(new TimeNum("9-11", 327));
        timeNums.add(new TimeNum("12-14", 227));
        timeNums.add(new TimeNum("15-17", 519));
        timeNums.add(new TimeNum("18-20", 1087));
        timeNums.add(new TimeNum("21-24", 116));
        return timeNums;
    }

    @ApiOperation("站台流量走势图")
    @PostMapping("/stationChaneByDay")
    public List<StationChaneByDay> StationChaneByDay() {
        List<StationChaneByDay> stationChaneByDays = new ArrayList<>();
        stationChaneByDays.add(new StationChaneByDay(1, 352));
        stationChaneByDays.add(new StationChaneByDay(2, 327));
        stationChaneByDays.add(new StationChaneByDay(3, 331));
        stationChaneByDays.add(new StationChaneByDay(4, 347));
        stationChaneByDays.add(new StationChaneByDay(5, 295));
        stationChaneByDays.add(new StationChaneByDay(6, 110));
        stationChaneByDays.add(new StationChaneByDay(7, 69));
        stationChaneByDays.add(new StationChaneByDay(8, 360));
        stationChaneByDays.add(new StationChaneByDay(9, 361));
        stationChaneByDays.add(new StationChaneByDay(10, 316));
        stationChaneByDays.add(new StationChaneByDay(11, 347));
        stationChaneByDays.add(new StationChaneByDay(12, 307));
        stationChaneByDays.add(new StationChaneByDay(13, 86));
        stationChaneByDays.add(new StationChaneByDay(14, 62));
        stationChaneByDays.add(new StationChaneByDay(15, 353));
        stationChaneByDays.add(new StationChaneByDay(16, 326));
        stationChaneByDays.add(new StationChaneByDay(17, 329));
        stationChaneByDays.add(new StationChaneByDay(18, 308));
        stationChaneByDays.add(new StationChaneByDay(19, 330));
        stationChaneByDays.add(new StationChaneByDay(20, 119));
        stationChaneByDays.add(new StationChaneByDay(21, 55));
        stationChaneByDays.add(new StationChaneByDay(22, 342));
        stationChaneByDays.add(new StationChaneByDay(23, 358));
        stationChaneByDays.add(new StationChaneByDay(24, 362));
        stationChaneByDays.add(new StationChaneByDay(25, 57));
        stationChaneByDays.add(new StationChaneByDay(26, 66));
        stationChaneByDays.add(new StationChaneByDay(27, 78));
        stationChaneByDays.add(new StationChaneByDay(28, 351));
        stationChaneByDays.add(new StationChaneByDay(29, 352));
        stationChaneByDays.add(new StationChaneByDay(30, 325));
        return stationChaneByDays;
    }
}


